home *** CD-ROM | disk | FTP | other *** search
/ MacAddict 108 / MacAddict108.iso / Software / Internet & Communication / WordPress 1.5.1.dmg / wordpress / wp-atom.php < prev    next >
Encoding:
PHP Script  |  2005-05-09  |  1.9 KB  |  46 lines

  1. <?php
  2.  
  3. if (empty($feed)) {
  4.     $blog = 1;
  5.         $feed = 'atom';
  6.     $doing_rss = 1;
  7.     require('wp-blog-header.php');
  8. }
  9.  
  10. header('Content-type: application/atom+xml; charset=' . get_settings('blog_charset'), true);
  11. $more = 1;
  12.  
  13. ?>
  14. <?php echo '<?xml version="1.0" encoding="'.get_settings('blog_charset').'"?'.'>'; ?>
  15. <feed version="0.3"
  16.   xmlns="http://purl.org/atom/ns#"
  17.   xmlns:dc="http://purl.org/dc/elements/1.1/"
  18.   xml:lang="<?php echo get_option('rss_language'); ?>"
  19.   >
  20.     <title><?php bloginfo_rss('name') ?></title>
  21.     <link rel="alternate" type="text/html" href="<?php bloginfo_rss('home') ?>" />
  22.     <tagline><?php bloginfo_rss("description") ?></tagline>
  23.     <modified><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastpostmodified('GMT'), false); ?></modified>
  24.     <copyright>Copyright <?php echo mysql2date('Y', get_lastpostdate('blog'), 0); ?></copyright>
  25.     <generator url="http://wordpress.org/" version="<?php bloginfo_rss('version'); ?>">WordPress</generator>
  26.     
  27.     <?php $items_count = 0; if ($posts) { foreach ($posts as $post) { start_wp(); ?>
  28.     <entry>
  29.           <author>
  30.             <name><?php the_author() ?></name>
  31.         </author>
  32.         <title type="text/html" mode="escaped"><![CDATA[<?php the_title_rss() ?>]]></title>
  33.         <link rel="alternate" type="text/html" href="<?php permalink_single_rss() ?>" />
  34.         <id><?php the_guid(); ?></id>
  35.         <modified><?php echo get_post_time('Y-m-d\TH:i:s\Z', true); ?></modified>
  36.         <issued><?php echo get_post_time('Y-m-d\TH:i:s\Z', true); ?></issued>
  37.         <?php the_category_rss('rdf') ?> 
  38.         <summary type="text/plain" mode="escaped"><![CDATA[<?php the_excerpt_rss(); ?>]]></summary>
  39. <?php if ( !get_settings('rss_use_excerpt') ) : ?>
  40.         <content type="<?php bloginfo('html_type'); ?>" mode="escaped" xml:base="<?php permalink_single_rss() ?>"><![CDATA[<?php the_content('', 0, '') ?>]]></content>
  41. <?php endif; ?>
  42. <?php rss_enclosure(); ?>
  43.     </entry>
  44.     <?php $items_count++; if (($items_count == get_settings('posts_per_rss')) && empty($m)) { break; } } } ?>
  45. </feed>
  46.